//
//  FeedsSourceViewController.m
//  Qya
//
//  Created by maxwellpang on 12-9-7.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "FeedsSourceViewController.h"
#import "FromQQFriendViewController.h"
#import "FromWebsiteViewController.h"
#import "FromPositionViewController.h"

#define FLOWER_SIZE 253.0f

@interface FeedsSourceViewController ()

@end

@implementation FeedsSourceViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    [sowImage setImage:[UIImage imageNamed:@"bozhonganniupingshi"]];
    CGPoint center = sowImage.center;
    center.y = -50;
    sowImage.center = center;
    CGContextRef context = UIGraphicsGetCurrentContext();
    [UIView beginAnimations:@"moveDown" context:context];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:0.5];

    center.y = center.y + 298;
    sowImage.center = center;
    
    [UIView commitAnimations];
    
    [UIView beginAnimations:@"expansion" context:context];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationDuration:0.3];
    [UIView setAnimationDelay:0.5];

    
    [sowImage setImage:[UIImage imageNamed:@"yuanpan"]];
    CGRect frame = [sowImage frame];
    frame.origin.x = frame.origin.x - (FLOWER_SIZE - frame.size.width)/2;
    frame.origin.y = frame.origin.y - (FLOWER_SIZE - frame.size.height)/2;
    frame.size.width = FLOWER_SIZE;
    frame.size.height = FLOWER_SIZE;
    [sowImage setFrame:frame];
    
    
    [yuanxin setImage:[UIImage imageNamed:@"xiaoyuanquanturang@2x"]];
    [yuanxin setFrame:frame];
    
    [UIView commitAnimations];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

-(IBAction)FeedsFromQQFriends:(id)sender
{
    FromQQFriendViewController *secondView = [[FromQQFriendViewController alloc] init];  
    [self.navigationController pushViewController:secondView animated:YES];
    
    secondView.title = @"QQ好友";
    [self.navigationController  setToolbarHidden:NO animated:YES]; 
}

-(IBAction)FeedsFromWebsite:(id)sender
{
    FromWebsiteViewController *secondView = [[FromWebsiteViewController alloc] init];  
    [self.navigationController pushViewController:secondView animated:YES];
    
    secondView.title = @"网站";
    [self.navigationController  setToolbarHidden:NO animated:YES]; 
}

-(IBAction)FeedsFromPosition:(id)sender
{
    FromPositionViewController *secondView = [[FromPositionViewController alloc] init];  
    [self.navigationController pushViewController:secondView animated:YES];
    
    secondView.title = @"附近的人";
    [self.navigationController  setToolbarHidden:YES animated:NO]; 
}

@end
